<template>
    <!-- component/smallchange/smallchange.wxml -->
    <view class="base-box">
        <view class="card-namebox2">
            <view class="cardname_lt">
                <view class="cardname_ltitem">
                    <view class="bill_moneytext">
                        账单金额：
                        <text class="bill_money">¥{{ num }}</text>
                        元
                    </view>
                    <view class="bill_moneytext">
                        需要支付：
                        <text class="bill_money">¥{{ payNum }}</text>
                        元
                    </view>
                </view>
            </view>
            <view class="sumtotal" @tap="smearbut">抹零</view>
        </view>
        <view class="base-botton">
            <view class="botton-entry" @tap="createServiceOrder">下一步</view>
            <view class="botton-entry" @tap="handbrand">挂单</view>
        </view>
    </view>
</template>

<script>
// component/smallchange/smallchange.js
export default {
    data() {
        return {
            num: 10,
            payNum: 20,
            showModalhandbrand: false,
            isRounding: false
        };
    },
    /**
     * 组件的属性列表
     */
    props: {},
    /**
     * 组件的方法列表
     */
    methods: {
        // getHangOrderInfo(){
        //   _request.get('/hangOrder/getHangOrder', {
        //     shopId: wx.getStorageSync("shopId")
        //   }).then(res=>{
        //     let hangOrderList = []
        //     if(res.data.data.storeHangOrderType === 1){
        //       for(let i = 0; i　< 30; i++){
        //         hangOrderList.push({
        //           brand: i+1,
        //           status: 0
        //         })
        //       }
        //       let data = res.data.data.data
        //       hangOrderList.forEach(i=>{
        //         data.forEach((j,index)=>{
        //           if(i.brand == Number(j.brand)){
        //             i.status = j.status
        //             data.splice(index, 1)
        //           }
        //         })
        //       })
        //       data.forEach(i=>{
        //         hangOrderList.push({
        //           brand: Number(i.brand),
        //           status: i.status
        //         })
        //       })
        //       console.log(data)
        //       console.log(hangOrderList)
        //     }else{
        //       hangOrderList = res.data.data.data
        //     }
        //     this.setData({
        //       hangOrderList: hangOrderList,
        //       selStatus: res.data.data.storeHangOrderType
        //     })
        //   })
        // },
        //挂单
        handbrand() {
            this.setData({
                showModalhandbrand: true
            });
            this.$emit('send', {
                detail: this.showModalhandbrand
            }); // this.getHangOrderInfo()
        },

        //
        smearbut() {
            this.setData({
                isRounding: true
            });
            this.$emit('rounding', {
                detail: this.isRounding
            }); // this.getMemberDiscount()
        },

        createServiceOrder() {
            console.log('占位：函数 createServiceOrder 未声明');
        }
    }
};
</script>
<style>
/* component/smallchange/smallchange.wxss */

.base-box {
    z-index: 9990;
    position: fixed;
    bottom: 0rpx;
    width: 100%;
    height: 450rpx;
    background: #ffffff;
    border: 1rpx solid #dcdcdc;
    box-shadow: 2rpx -9rpx 20rpx 0rpx rgba(160, 159, 159, 0.1);
}
.card-namebox {
    height: 99rpx;
    width: 750rpx;
    display: flex;
    line-height: 99rpx;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1rpx solid #e5e5e5;
}

.card-namebox2 {
    width: 670rpx;
    margin: 0 auto;
    height: 200rpx;
    display: flex;
    line-height: 99rpx;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1rpx solid #e5e5e5;
}

.cardname_lt {
    display: flex;
    align-items: center;
    height: 110rpx;
}
.bill_moneytext {
    font-size: 30rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #333333;
}

.bill_money {
    color: #e94a18;
}

.sumtotal {
    width: 140rpx;
    text-align: center;
    line-height: 60rpx;
    height: 60rpx;
    background: #e94a18;
    border-radius: 30rpx;
    font-size: 26rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #ffffff;
}

.base-botton {
    width: 670rpx;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    margin-top: 76rpx;
}

.botton-entry {
    text-align: center;
    line-height: 80rpx;
    width: 320rpx;
    height: 80rpx;
    background: #e94a18;
    border-radius: 40rpx;
    font-size: 26rpx;
    font-family: Adobe Heiti Std;
    font-weight: normal;
    color: #ffffff;
}
</style>
